<?php
/**
*
* ClassName: Unlock_log_model
*
* 解锁新浪html页面搜索封IP 日志模型
*
* @author hejigui <hejigui@soften.cn>
*
*/
class Unlock_log_model extends CI_Model {

    private $_write_db;
    private $_project;
    function __construct()
    {
        parent::__construct();
        $this->_write_db = $this->load->database('master', TRUE);
    }


    /**
    * 记录解锁日志
    *
    * @access public
    * @param array $log_data xxxxxx [Must]
    * @return int $mixed
    */
    public function record_log($log_data) {

		if($log_data['get_yzm_val_time']){
			$log_data['yzm_used_time'] = $log_data['get_yzm_val_time'] - $log_data['upload_time'];
		}

    	$log_data['unlock_time'] = ($log_data['unlock_time']) ? $log_data['unlock_time'] : time();

    	$log_data['unlock_used_time'] = $log_data['unlock_time'] - $log_data['start_time'];
        $this->_write_db->insert('unlock_log', $log_data);
        return $this->_write_db->insert_id();
    }

}